import fetch from 'utils/fetch';


export function goodsGroup() {
    return fetch({
        url: '/api/shop/goods/group/admin/allShopGroup',
        method: 'get'
    })
}

export function goodsGroupPageList(query) {
    return fetch({
        url: '/api/shop/goods/group/admin/list',
        method: 'get',
        params: query
    })
}

export function addGoodsGroup(obj) {
    return fetch({
        url: '/api/shop/goods/group/admin/addGoodsGroup',
        method: 'post',
        data: obj
    })
}

export function getGroup(id) {
    return fetch({
        url: '/api/shop/goods/group/admin/getShopsInfo/' + id,
        method: 'get'
    })
}

export function updateGroup(group) {
    return fetch({
        url: '/api/shop/goods/group/admin/updateGroup',
        method: 'put',
        data: group
    })
}

export function deleteGroup(id) {
    return fetch({
      url: '/api/shop/goods/group/admin/deleteGroup/' + id,
      method: 'delete'
    })
  }

export function groupList(query){
    return fetch({
        url:'/api/shop/goods/group/admin/groupAdList',
        method: 'get',
        params: query
    })
}

export function getGroupStatus(id){
    return fetch({
        url: '/api/shop/goods/group/admin/groupByStatus/' + id,
        method: 'get'
    })
}

export function updateGroupRecomm(groupRecomm){
    return fetch({
        url: '/api/shop/goods/group/admin/updateGroupRecomm',
        method: 'put',
        data:groupRecomm
    })
}